﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CApAPPActiveCollisionClearanceViewModel
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using System.Collections.Generic;
using System.Collections.ObjectModel;


namespace DnProcessSimulateCommands;

internal class CApAPPActiveCollisionClearanceViewModel : 
  ObservableCollection<CApAPPActiveCollisionClearancePair>
{
  private CApAPPActiveCollisionClearancePair _selectedActiveCollisionPair;

  public CApAPPActiveCollisionClearancePair SelectedActiveCollisionPair
  {
    get => this._selectedActiveCollisionPair;
    set => this._selectedActiveCollisionPair = value;
  }

  public ObservableCollection<CApAPPActiveCollisionClearancePair> ActiveCollisionPairs { get; set; }

  public CApAPPActiveCollisionClearanceViewModel()
  {
    this.ActiveCollisionPairs = new ObservableCollection<CApAPPActiveCollisionClearancePair>();
    this.AddRange(CApAPPActiveCollisionClearanceUtilities.GetAllActiveCollisionSets());
  }

  private void AddRange(List<CApAPPActiveCollisionClearancePair> pairList)
  {
    foreach (CApAPPActiveCollisionClearancePair pair in pairList)
      this.ActiveCollisionPairs.Add(pair);
  }

  internal void UpdateAttributes()
  {
    foreach (CApAPPActiveCollisionClearancePair activeCollisionPair in (Collection<CApAPPActiveCollisionClearancePair>) this.ActiveCollisionPairs)
      activeCollisionPair.Update();
  }

  internal void RestoreDefaults()
  {
    foreach (CApAPPActiveCollisionClearancePair activeCollisionPair in (Collection<CApAPPActiveCollisionClearancePair>) this.ActiveCollisionPairs)
      activeCollisionPair.RestoreDefaults();
  }
}
